package com.cheer.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cheer.entity.DocumentTemplate;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface DocumentTemplateDao extends BaseMapper<DocumentTemplate> {

    default DocumentTemplate getByType(Integer type) {
        return selectOne(new QueryWrapper<DocumentTemplate>()
            .eq("doc_type", type)
            .last("limit 1"));
    }
}
